//
//  ViewController.m
//  panduan
//
//  Created by rimi on 16/6/30.
//  Copyright © 2016年 hangge. All rights reserved.
//

#import "ViewController.h"
#import "CompareTimes.h"
#import "Viewdonghua.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    NSString *dateStrStart = @"2015-08-10";
    NSString *dateStrStop = @"2016-08-10";
    NSLog(@"%d",[CompareTimes compareStartDate:dateStrStart stopDate:dateStrStop]);
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"yyyy-MM-dd"];
    NSDate *startDate = [dateFormatter dateFromString:dateStrStart];
    NSDate *stopDate = [dateFormatter dateFromString:dateStrStop];
    NSLog(@"%@", startDate);
    NSLog(@"%@",stopDate);
    [self button];
    NSLog(@"1112");
    NSLog(@"11");
    // Do any additional setup after loading the view, typically from a nib.
}


- (void)button {
    UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
//        button.frame = CGRectMake(10, 10, 10, 10);
    button.bounds = CGRectMake(0, 0, 120, 50);
    button.center = CGPointMake(185, 350);
    [button setTitle:@"动画" forState:UIControlStateNormal];
    [button addTarget:self action:@selector(buttonTaped:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];
    
}

- (void)buttonTaped:(UIButton *)sender {
    
    UIImageView * btn2=[[UIImageView alloc] initWithFrame:CGRectMake(self.view.center.x/2 + 200, self.view.center.y/2 + 200, 40, 40)];
    [btn2 setImage:[UIImage imageNamed:@"logo"]];
    [self.view  addSubview:btn2];
    [Viewdonghua shoppingCartView:btn2];
}



@end
